﻿using Microsoft.Extensions.DependencyInjection;
using MiddlewareTest.AppBuilder;
using MiddlewareTest.CustomMiddlewares;
using MiddlewareTest.Middleware;
using MiddlewareTest.MiddlewareDelegate;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace MiddlewareTest
{
    public class Startup : IStartup
    {
        private readonly IServiceProvider _service;
        public Startup(IServiceProvider service)
        {
            _service = service;
        }

        public async Task StartAsync()
        {
            RequestContext context = new RequestContext();

            var builder = _service.GetRequiredService<IApplicationBuilder>();

            builder.Use<Test1Middleware>();

            builder.Use<Test2Middleware>();

            var cesultContext = await builder.BuildAsync(context);
        }

    }
}
